package homework_05;

import java.util.Arrays;

public class home_04 {
    public static void shunxu(int[] nums){
        for (int i=1;i<nums.length;i++){
            for (int j=0;j<nums.length-i;j++){
                int temp;
                if (nums[j]>nums[j+1]){
                    temp=nums[j];
                    nums[j]=nums[j+1];
                    nums[j+1]=temp;
                }
            }
        }
    }

    public static void main(String[] args) {
        int[] a={6,5,4,3,2,1};
        shunxu(a);
        System.out.println(Arrays.toString(a));
    }
}
